<?php
class system_setting_language extends system_setting_abstract {

	public function init() {
		parent::init('language', array('id' => 1, 'name' => 'en_us', 'value' => 'English'));
	}
	
	public static function verify($str) {
		return preg_match('/^[a-z]{2}_[a-z]{2}$/is', $str);
	}
	
	public static function getCurrentHost() {
		$_host = '';
		if(preg_match('/([a-z0-9-]+\.[a-z]{2,10})$/is', strtolower($_SERVER['HTTP_HOST']), $host)) {
			$_host = $host[1];
		} else {
			$_host = $_SERVER['HTTP_HOST'];
		}
		return $_host;
	}
	
}

